package com.woniu.apiimpl;


import com.woniu.api.HisCheckAPI;
import com.woniu.dto.CheckDto;
import com.woniu.dto.CheckListDto;
import com.woniu.dto.QueryCheckDto;
import com.woniu.param.CreateOrModifyCheckParam;
import com.woniu.param.DelCheckParam;
import com.woniu.param.QueryCheckParam;
import com.woniu.service.IHisCheckService;
import com.woniu.util.Result;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 检查项目表 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2021-11-11
 */
@RestController
@RequestMapping("/check")
public class HisCheckAPIImpl implements HisCheckAPI {

    @Resource
    private IHisCheckService checkService;

    @Override
    public Result<CheckListDto> createOrModifyCheck(CreateOrModifyCheckParam param) {
        CheckListDto checkListDto = checkService.createOrModifyCheck(param);
        return Result.bulid(CheckListDto.class).setData(checkListDto);
    }

    @Override
    public Result delCheck(DelCheckParam param) {
        checkService.delCheck(param);
        return Result.bulid();
    }

    @Override
    public Result<QueryCheckDto> queryCheck(QueryCheckParam param) {
        QueryCheckDto queryCheckDto = checkService.queryCheck(param);
        return Result.bulid(QueryCheckDto.class).setData(queryCheckDto);
    }

    @Override
    public Result changeCheck(Integer patientId) {
        checkService.changeCheck(patientId);
        return Result.bulid();
    }
}

